package com.lc.lc1109;


public class Main {
	
	

}

class Solution {
    public int[] corpFlightBookings(int[][] bookings, int n) {
        int[] t = new int[n + 2];
        for (int i = 0; i < bookings.length; i ++) {
        	int a = bookings[i][0];
        	int b = bookings[i][1];
        	int c = bookings[i][2];
        	
        	t[a] += c;
        	t[b + 1] -=c;
        }
        int[] res = new int[n];
        int r = 0;
        for (int i = 1; i <= n; i ++) {
        	r += t[i];
        	res[i - 1] = r;
        }
        return res;
        
    }
}
